// 请求接口
import { getList,deleteSupplier,addSupplier,getInfo,editSupplier} from '@/api/supplier'


const state = {}

const mutations = {}

const actions = {

  // 获取 供应商 列表信息
  async getList({commit},serchForm) {
    let res = await getList(serchForm);
    return res
  },
  // 删除供应商信息
  async deleteSupplier({},id) {
    let res = await deleteSupplier(id);
    return res
  },
  // 添加供应商信息
  async addSupplier({},supplierForm) {
    const res = await addSupplier(supplierForm);
    return res
  },
  // 获取单个供应商信息
  async getInfo({},id) {
    const res = await getInfo(id);
    return res
  },
  // 修改单个供应商信息
  async editSupplier({},supplierInfo) {
    const res = await editSupplier(supplierInfo.id,supplierInfo);
    return res
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}

